<template>
    <div>
        <div class="banner" @click="handleclick" >
            <img class="banner-img" 
            :src="bannerImg" >
            <div class="banner-info">
                <div class="banner-title">{{this.sightName}}</div>
                <div class="banner-number">{{this.gallaryImgs.length}}</div>
            </div>
        </div>
        <fade>
            <commonGallary :imgs='gallaryImgs' 
                        v-show="showgallary" 
                        @close="gallaryclose">
            </commonGallary>
        </fade>
    </div>
</template>

<script>
import commonGallary from '@/common/gallary/Gallary'
import Fade from '@/common/fade/Fade'
export default {
  name: 'detailbanner', 
  props:{
      sightName:String,
      bannerImg:String,
      gallaryImgs:Array
  },
  data() {
      return {
          showgallary:false
  }
  },
  methods: {
       handleclick(){
            this.showgallary = true
        },
        gallaryclose(){
            this.showgallary = false
        }
  },
  components:{
      commonGallary,
      Fade
  }
    }
</script>

<style scoped>
    .banner{
        position: relative;
        overflow: hidden;
        height: 0;
        padding-bottom: 55%;
    }
    .banner-img{
        width: 100%;
    }
    .banner-info{
        display: flex;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        line-height: .6rem;
        color: #fff;
        background-image: linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.8))
    }
    .banner-title{
        padding:0 .2rem;
        flex: 1;
        font-size: .32rem;
    }
    .banner-number{
        padding: 0 .4rem;
        line-height: .36rem;
        height: .36rem;
        background: black;
        border-radius: .2rem;
        margin-top: .12rem;
        font-size: .26rem;
    }
</style>